package timing.ukulele.common.dictionary;

import java.util.Arrays;

/**
 * 第三方平台类型
 */
public enum ThirdPartyTypeEnum {
    WX_WEB(0, "微信网页端"),
    WX_APP(1, "微信小程序"),
    WX_MP(2, "微信公众号"),
    ALI_MP(3, "支付宝生活号");

    /*** 第三方平台类型*/
    private Integer value;

    /*** 第三放平台描述*/
    private String description;

    ThirdPartyTypeEnum(Integer value, String description) {
        this.value = value;
        this.description = description;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public static Boolean hasValue(Integer value) {
        long count = Arrays.stream(values()).filter(item -> item.value.equals(value)).count();
        return count > 0;
    }
}
